package demo03

/**
 * @author xiaoZhao
 * @date 2022/6/24
 * @describe 打印九层塔
 */
object Test04_Practice_Pyramid {
  def main(args: Array[String]): Unit = {
    for {
      i <- 1 to 9
      j = 2 * i -1
      space = 9 - i
    }
    {
      println(" " * space+ "*" *  j)
    }

    for (starts <- 1 to 17 by 2; space = (17 - starts) / 2){
      println(" " * space+ "*" *  starts)
    }
  }
}
